/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.mycompany.ingsoc2;

import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;

/**
 *
 * @author sebastian
 */
public class ModelDBMYSQL implements ModelDB {

    public ModelDBMYSQL() {
    }
/**
 * 
 * @param conn
 * @return
 * @throws SQLException 
 */
    @Override
    public boolean createModel(Connection conn) throws SQLException {
        Statement stmt = conn.createStatement();
        stmt.executeUpdate("CREATE TABLE genero(id int IDENTITY, nombre varchar(100));");
        stmt.executeUpdate("CREATE TABLE pelicula("
                + "id int AUTO_INCREMENT, "
                + "titulo varchar(100),"
                + "descripcion varchar(100),"
                + "actor_principal varchar(100),"
                + "duracion int,"
                + "director varchar(100),"
                + "id_genero int);");

        return true;

    }
}
